package com.cauli.file.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cauli.model.entity.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Cauli
 * @date 2023-03-18 12:00
 * @description 文件上传
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("upload_task")
@ApiModel(value = "UploadTask", description = "文件上传")
public class UploadTask extends BaseEntity {
    /**
     * 文件上传ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId("upload_task_id")
    private Long uploadTaskId;

    /**
     * 用户ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("user_id")
    private Long userId;

    /**
     * 文件名称
     */
    @TableField("file_name")
    private String fileName;

    /**
     * 扩展名
     */
    @TableField("extend_name")
    private String extendName;

    /**
     * 文件路径
     */
    @TableField("file_path")
    private String filePath;

    /**
     * md5唯一标识
     */
    @TableField("identifier")
    private String identifier;

    /**
     * 上传状态(0失败 1成功 2未完成)
     */
    @TableField("upload_status")
    private Integer uploadStatus;
}

